﻿<%@ Page Language="C#" MasterPageFile="~/Enterprise/Master/AdminMaster.Master" AutoEventWireup="true" 
    CodeBehind="InvocieList.aspx.cs" Inherits="HZ.DrugTrade.Web.Enterprise.InvoiceManage.InvocieList"
    Title="发票列表" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="tabnav">
        <ul>
            <li><a href="UnInvoiceList.aspx">待开票企业</a></li>
            <li class="active"><a href="InvocieList.aspx">发票列表</a></li>
        </ul>
    </div>
    <div id="tabcontent">
        <table class="querylist">
            <tr>
                <td>
                    <table class="querylist">
                        <tr>
                            <td align="right">
                                发票号：
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtInvoiceID" runat="server"></asp:TextBox>
                            </td>
                            <td align="right">
                                发票时间：
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtTimeFrom" runat="server" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd '})"
                                    Width="62px" MaxLength="10"></asp:TextBox>-<asp:TextBox ID="txtTimeTo" runat="server"
                                        onFocus="WdatePicker({dateFmt:'yyyy-MM-dd '})" MaxLength="10" Width="62px"></asp:TextBox>
                            </td>
                            <td rowspan="2">
                                <asp:Button ID="btnSelect" runat="server" Text="查  询" OnClick="btnSelect_Click" CssClass="btn" />
                            </td>
                        </tr>
                        <tr>
                            <td align="right">
                                采购医疗机构：
                            </td>
                            <td align="left">
                                <asp:TextBox ID="txtHospitalName" runat="server"></asp:TextBox>
                            </td>
                            <td align="right">
                                审核状态：
                            </td>
                            <td align="left">
                                <asp:DropDownList ID="ddlAuditStatus" runat="server">
                                    <asp:ListItem Value="">全部</asp:ListItem>
                                    <asp:ListItem Value="0">未提交</asp:ListItem>
                                    <asp:ListItem Value="1">已提交</asp:ListItem>
                                    <%--<asp:ListItem>审核不通过</asp:ListItem>--%>
                                </asp:DropDownList>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </div>
    <asp:GridView ID="gvwInvoiceList" class="mainlist" runat="server" AutoGenerateColumns="False"
        EmptyDataText="暂无符合条件的数据！" OnRowCommand="gvwInvoiceList_RowCommand">
        <Columns>
            <asp:TemplateField HeaderText=" ">
                <HeaderTemplate>
                    <input id="addTable_chkAll" name="chkAll" type="checkbox" onclick="SelectAllCheckboxes(this,'ctl00_ContentPlaceHolder1_gvwInvoiceList','addTable_chkAll'); " />
                </HeaderTemplate>
                <ItemTemplate>
                    <input type="checkbox" name="ChkID" id="ChkID" value='<%#Eval("InvoiceSerialID")%>'
                        <%#Eval("AuditStatus").ToString() == "1" ? "disabled='disabled'" : ""%> onclick="chkChecked(this,'ctl00_ContentPlaceHolder1_gvwInvoiceList','addTable_chkAll');" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="发票号">
                <ItemTemplate>
                    <a href='InvoiceAdd.aspx?InvoiceSerialID=<%# Eval("InvoiceSerialID") %>&hID=<%#Eval("HospitalID")%>&checkstatus=<%#Eval("AuditStatus")%>'>
                        <asp:Label runat="server" ID="lblReturnName" Text='<%# HttpUtility.HtmlEncode(Eval("InvoiceID").ToString()) %>'></asp:Label></a>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="InvoiceSerialID" HeaderText="发票流水号" ReadOnly="true" Visible="False" />
            <asp:BoundField DataField="Hospitalname" HeaderText="采购医疗机构" ReadOnly="true" />
            <asp:BoundField DataField="TotalAmount" HeaderText="发票总金额" ReadOnly="true" DataFormatString="{0:F2}" />
            <asp:BoundField DataField="DistributionCount" HeaderText="配送单数量" ReadOnly="true" />
            <asp:BoundField DataField="InvoiceTime" HeaderText="发票日期" ReadOnly="true" DataFormatString="{0:yyyy-MM-dd}" />
            <asp:BoundField DataField="AuditTime" HeaderText="提交时间" ReadOnly="true" DataFormatString="{0:yyyy-MM-dd}" />
            <asp:BoundField DataField="AddDate" HeaderText="录入时间" ReadOnly="true" DataFormatString="{0:yyyy-MM-dd}" />
            <asp:BoundField DataField="NoPassReason" HeaderText="审核未通过原因" ReadOnly="true" Visible="false" />
            <asp:BoundField DataField="HospitalID" HeaderText="HospitalID" ReadOnly="true" Visible="False" />
            <asp:TemplateField HeaderText="发票状态">
                <ItemTemplate>
                    <%# Eval("AuditStatus").ToString() == "0" ? "未提交":"已提交"%>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField HeaderText="操作">
                <ItemTemplate>
                    <%#Eval("AuditStatus").ToString() == "1" ? "" : getA(Eval("InvoiceSerialID"))%>
                    <hz:HzLinkButton ID="lbnSubmit" runat="server" Visible='<%#Eval("AuditStatus").ToString() == "0"%>' OnClientClick="if(!this.disabled){return  confirm('确认要提交此发票给医疗机构吗？');}else{return false;}"
                        CommandName="submit" CommandArgument='<%# Eval("InvoiceSerialID") %>' Text="提交" 
                        ToolTip="提交此发票给医疗机构" />
                        <hz:HzLinkButton ID="lbnRevoke" runat="server" OnClientClick="if(!this.disabled){return  confirm('确认要撤回此发票吗？');}else{return false;}"
                        CommandName="Revoke" CommandArgument='<%# Eval("InvoiceSerialID") %>' Text="撤回" Visible='<%#Eval("AuditStatus").ToString() == "1"? true:false%>'
                        ToolTip="撤回此发票" />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <div class="page">
        <webdiyer:AspNetPager ID="AspNetPager1" runat="server" OnPageChanged="AspNetPager1_OnPageChanged">
        </webdiyer:AspNetPager>
    </div>
    <div class="listip">
        <ul>
            <li>提示:</li>
        </ul>
    </div>
    <div class="listctrl">
        <%--        <hz:HzButton ID="btnAdd" runat="server" Text="新增发票" CssClass="btn" ToolTip="新增一条发票单"
            OperateType="新增" OnClick="btnAdd_Click" />--%>
        <hz:HzButton ID="btnDel" runat="server" Text="删除发票" OnClientClick="return checkSelectedItems('ctl00_ContentPlaceHolder1_gvwInvoiceList','请至少选择一条发票！') && confirm('确定删除吗？');"
            OnClick="btnDelete_Click" CssClass="btn" ToolTip="删除发票单" OperateType="删除" />
            <hz:HzButton ID="btnExport" runat="server" Text="导出Excel" CssClass="btn" ToolTip="导出Excel"
                        OnClick="btnExport_Click" />
        <%--<hz:HzButton ID="btnSubmit" runat="server" Text="提交给医疗机构" OnClientClick="return checkSelectedItems('ctl00_ContentPlaceHolder1_gvwInvoiceList','请至少选择一条发票！') && confirm('确定将发票提交给医疗机构吗？');"
            OnClick="btnSubmit_Click" CssClass="btn" ToolTip="将发票提交给医疗机构" OperateType="删除"
            Width="85px" />--%>
    </div>
</asp:Content>
